Moved function calls inside the image bind