Added close function, set auto position and auto resize to run on image load