Made the active image work properly and fixed background