VID-2013 adding bucky profiling to media galleries and some code cleaunup