makes a new function to check and handle the img