Renamed subs, added experimental image code (to get the extension)