added try around image creation