bugfix: get_headers() throws error if allow_url_fopen=0

uses header info from my_get_remote_content() function to determine
image type. get_headers() didnot work in my setup.