Tiled Gallery: Fix top and bottom margin resize.

Resizing would make the bottom and top margin look larger than the left and right margins. If we don't subtract the marginHeight from the new height, it should work.