Defining custom graphics for gui is in my opinion problematic. There is problem with alignment of short vehicles in trunk. When you try your set in official branch of OpenTTD and set your language to right-to-left (for example arabic) and you try different combination of locos and wagons, you will see alignment glitches there too. I was trying to fix alignment problem in this patch (it's essential for NewGRFs that don't use custom gui sprites), which results in what you see because alignment is changed. Also I made a PR for trunk, but I'm holding back with it for a while, because it's going to affect GRFs that use this feature and I'm not sure about all the consequences yet. Ignoring custom gui graphic in this patch should be possible and easy if you are fine with it.
Unfortunately, there are some cases when we have no choice: vehicles longer than 8/8, for instance, need to use custom non-viewport graphics, since they're defined as 3 graphically separate parts in viewport (to avoid glitches), while they have a single sprite in depots, purchase list, vehicle GUI etc. So I'm afraid this patch will have to take this into account.
Additionally, all my horizontal sprites in viewport include a line of dark grey pixels underneath them, to draw a shade on the rails they travel on (otherwise you'd see shiny rails under a vehicle!). That shade shouldn't be there in views other than viewport, hence the need of custom sprites.
Alternatively, I would have to add one extra set of non-viewport sprites with different offsets and have a parameter to switch to them, if this patch doesn't explicitly support different sprites.
As for your other question (through PM), yours was a good catch: I do switch across liveries using the "getubyte" function, like this for example:
// What's this engine's livery?
ref(24) if(1) // Corsica
ref(29) else // Brittany
This is the final part of the code for the engine in my example, where refs (24) and (29) are the final callbacks for each locomotive livery. I use a very similar code to choose the liveries of the wagons as well.