Added code for media gallery