Pins inside the image

Fixed bug, the pins are never placed out of the image.