Fix to bug with uploading images