Updated gallery image loading