Fixed image gallery bug