Add image size support for gallery layout.