Image extract logic