Added check of ellipse being outside image