moved fileprefix into variable
added handling for images sent as url and images uploaded through twitter