added new functions for image upload