Removed static variable in get_correct_image_extension to avoid race conditions

12 jobs for 18-load-images-based-on-magic-numbers-instead-of-filename-extension-in-c in 48 minutes and 53 seconds (queued for 3 seconds)