changing image gallery constructor