Fixing memory leak with background image