solves issues in photo upload