fixed some issues with saving images. authentication checking after saving image still needs to be fixed