Nice progress with the filtering

Just an small correction, in the conditionals of this line you was not telling the codec identifyer
src="xcb://localhost/query?ssort=root.sort_selected.photo_all&cond=Aa+Photo:Photo.codec+Ae+Photo:Photo.width 270+Ae+Photo:Photo.height 340"
What i highlighted in bold (Photo:Photo.codec) is the database access path (ordered like a hierarchy, from top to bottom, you are descending 3 levels)
Inmediatly after it (separated by an space) is needed to tell the codec identifyer, so the correct way to do it should be with something like this:
src="xcb://localhost/query?ssort=root.sort_selected.photo_all&cond=Aa+Photo:Photo.codec SOMETHING+Ae+Photo:Photo.width 270+Ae+Photo:Photo.height 340"
I guess this mistake in the conditions of the filter is making all the codecs valid (so is not really filtering the search "by codec")... not sure though
Also, im not sure which values are valid for the codecs, in the wiki doesnt appears any example for them
https://www.psdevwiki.com/ps3/XMB_database#Photo
Most probably inside the dabatabase files the values of that codecs are stored as a number (things like 0x120 instead of JPG) but in this example i dont know which one you are supposed to use in the XML (either the 0x120 or the JPG from my previous example)
Maybe the firmware allows to type JPG in the XMBML files and it does the "translation" back from the 0x120 at the time is loaded
In the worst scenario posible (incase the syntax rules used in the XMBML files only allows to use numbers to identify the codecs), we can harvest that values by scanning some sample database files with a modifyed version of the
db3crawler
The concept is the same, but is needed to modify the search patterns and output only the filename + the value of the codec
-----------------------------
To use the good looking grid mode i think you are going to need to "build" it inside registory.xml
This file allows to build on a higher level, as far i remember there are a few syntax constructions (in that "src" lines) that are exclusive for it
In some way is like dividing the custom code in half and using registory.xml as a proxy to access the database files