$have_image should not be array(1=>1). {if $have_image} fails