{% if images.has_previous %}
First
Prev
{% endif %}
{% for num in images.paginator.page_range %}
{% if images.number == num %}
{{ num }}
{% elif num > images.number|add:'-3' and num < images.number|add:'3' %}
{{ num }}
{% endif %}
{% endfor %}
{% if images.has_next %}
Next
Last
{% endif %}