Fix addImageToGallery method to manipulate the container, not the array