Common image upload functionality

Common image upload functionality