Added functionality to add uploaded images to the gallery