fixed issues with image uploads