Changed from '.jpg' in til endswith