Fix image function