add auto height and auto width for slide in gallery view