checking image type during download