fix for adding image to gallery