fix for Error PHP array_key_exists() ...

… and added download function directly from image