Mercury branch - all the changes and functionality we need to have Mercury skin working

DO NOT MERGE, THIS PR IS PART OF PROJECT MERCURY! 
Just because it is currently the only place that you could find all the info you need is not a good reason to change the behavior of the function in unexpected ways. Wouldn't a better way to handle this be through a clear chain of transformations? That is, get the gallery data -> add the attributes you need -> render in the requested format.

How are you going to test this to make sure that the object generated has the fields in the format that you expect?