added image initialisation to resize image on upload