bugfix: if image extension is uppercase then "Image is not valid" is raised